const express = require('express')
const app = express()
const cors = require('cors')

app.get('/jsonp',(req,res)=>{
    let cb = req.query.callback;
    let data = {name:'jsonp接口', msg:'只支持get'}
    let str = `${cb}(${JSON.stringify(data)})`; 
    console.log(str)
    res.send(str)
})

app.get('/home',(req,res)=>{
    res.send({name:'get'})
})

app.listen(8080,()=>{
    console.log('8080 running')
})